package com.njth.beans;

import javax.servlet.http.HttpServletRequest;

import com.njth.util.Config;

public class Product extends BaseBean{
	/**
	 * 
	 */
	private static final long serialVersionUID = -7206175705440688062L;

	private String name;/* 产品名称 */

	private Double Oprice;/* 产品原始价格 */

	private Double Sprice;/* 产品真实价格 */

	private Category category;/* 产品类别 */

	private int status;/* 产品状态，是否有货，1为有货，0为无货 */

	private String ppic1;/* 产品图片，小图 */
	
	private String ppci1Thumbnail;

	private String ppic2;/* 产品图片，大图 */
	
	private String ppic2Thumbnail;

	private String pinfo;/* 产品性能参数 */

	private String minfo;/* 产品性能参数 */

	private String tinfo;/* 产品性能参数 */

	private String einfo;/* 产品性能参数 */

	public Product() {

	}

	public Product(int id, String name, Double Oprice, Double Sprice,
			Category category, int status, String ppic1, String ppic2,
			String pinfo, String tinfo, String einfo, String minfo) {
		super.setId(id);
		this.name = name;
		this.Oprice = Oprice;
		this.Sprice = Sprice;
		this.category = category;
		this.status = status;
		this.ppic1 = ppic1;
		this.ppic2 = ppic2;
		this.pinfo = pinfo;
		this.minfo = minfo;
		this.einfo = einfo;
		this.tinfo = tinfo;

	}

	/* 以下为各个产品的属性的SET和GET方法 */
	

	public String getEinfo() {
		return einfo;
	}

	public void setEinfo(String einfo) {
		this.einfo = einfo;
	}


	public String getMinfo() {
		return minfo;
	}

	public void setMinfo(String minfo) {
		this.minfo = minfo;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Double getOprice() {
		return Oprice;
	}

	public void setOprice(Double oprice) {
		Oprice = oprice;
	}

	public String getPpci1Thumbnail() {
		return ppci1Thumbnail;
	}
	
	public String getPpic1ThumbnailURI(HttpServletRequest request){
		if(this.ppci1Thumbnail==null){
			return request.getContextPath()+"/com/njth/images/3page_pic1.jpg";
		}
		return request.getContextPath()+"/"+Config.getConfigProperty("uploadImagePath")+"/"+this.ppci1Thumbnail;
	}
	
	public String getPpic2ThumbnailURI(HttpServletRequest request){
		if(this.ppic2Thumbnail==null){
			return request.getContextPath()+"/com/njth/images/3page_pic2.jpg";
		}
		return request.getContextPath()+"/"+Config.getConfigProperty("uploadImagePath")+"/"+this.ppic2Thumbnail;
	}
	
	public String getPpic1URI(HttpServletRequest request){
		return request.getContextPath()+"/"+Config.getConfigProperty("uploadImagePath")+"/"+this.ppic1;
	}
	
	public String getPpic2URI(HttpServletRequest request){
		return request.getContextPath()+"/"+Config.getConfigProperty("uploadImagePath")+"/"+this.ppic2;
	}

	public void setPpci1Thumbnail(String ppci1Thumbnail) {
		this.ppci1Thumbnail = ppci1Thumbnail;
	}

	public String getPpic2Thumbnail() {
		return ppic2Thumbnail;
	}

	public void setPpic2Thumbnail(String ppic2Thumbnail) {
		this.ppic2Thumbnail = ppic2Thumbnail;
	}

	public String getPinfo() {
		return pinfo;
	}

	public void setPinfo(String pinfo) {
		this.pinfo = pinfo;
	}

	public String getPpic1() {
		return ppic1;
	}

	public void setPpic1(String ppic1) {
		this.ppic1 = ppic1;
	}

	public String getPpic2() {
		return ppic2;
	}

	public void setPpic2(String ppic2) {
		this.ppic2 = ppic2;
	}

	public Double getSprice() {
		return Sprice;
	}

	public void setSprice(Double sprice) {
		Sprice = sprice;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getTinfo() {
		return tinfo;
	}

	public void setTinfo(String tinfo) {
		this.tinfo = tinfo;
	}

	public Category getCategory() {
		return category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}
}
